package com.rk.kbk.model;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.rk.kbk.common.DateJsonDeserializer;
import com.rk.kbk.common.DateJsonSerializer;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * @Goods
 * @商品(goods)
 * @version : Ver 1.0
 */
@Entity
public class Goods implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * @备注:装备商城
	 * @字段:id BIGINT(19)
	 */
	@Id
	@GeneratedValue(strategy= GenerationType.IDENTITY)
	@GenericGenerator(name="auto-identity",strategy="identity")
	@Column(updatable = false, columnDefinition="BIGINT(19) COMMENT '装备商城'")
	private java.lang.Long id;

	/**
	 * @备注:标题
	 * @字段:title VARCHAR(44)
	 */
	@Column(columnDefinition="VARCHAR(44) COMMENT '标题'")
	private java.lang.String title;

	/**
	 * @备注:图片
	 * @字段:goods_url TEXT(65535)
	 */
	@Column(columnDefinition="TEXT(65535) COMMENT '图片'")
	private java.lang.String goodsUrl;

	/**
	 * @备注:商品详情
	 * @字段:textcontent TEXT(65535)
	 */
	@Column(columnDefinition="TEXT(65535) COMMENT '商品详情'")
	private java.lang.String goodsDetail;

	/**
	 * @备注:地址id
	 * @字段:address INT(10)
	 */
	@ManyToOne
	@JoinColumn(name="address", columnDefinition="INT(10) COMMENT '地址id'")
	private Address address;

	/**
	 * @备注:1表示骑手商城,2表示商家商城
	 * @字段:goods_type INT(10)
	 */
	@Column(columnDefinition="INT(10) COMMENT '1表示骑手商城,2表示商家商城'")
	private java.lang.Integer goodsType;

	/**
	 * @备注:
	 * @字段:gmt_datetime DATETIME(19)
	 */
	@Column(updatable = false, columnDefinition="DATETIME(19) COMMENT ''")
	@JsonSerialize(using=DateJsonSerializer.class)
	@JsonDeserialize(using=DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
	private java.util.Date gmtDatetime = new java.util.Date();

	/**
	 * @备注:
	 * @字段:upt_datetime DATETIME(19)
	 */
	@Column(columnDefinition="DATETIME(19) COMMENT ''")
	@JsonSerialize(using=DateJsonSerializer.class)
	@JsonDeserialize(using=DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
	private java.util.Date uptDatetime = new java.util.Date();

	private java.lang.Integer status;//状态 1正常0废弃

	@Transient
	private List<Map> goodsUnits;

	public Goods(){
	}

	public Goods(
		java.lang.Long id
	){
		this.id = id;
	}



	public void setId(java.lang.Long id) {
		this.id = id;
	}

	public java.lang.Long getId() {
		return this.id;
	}


	public void setTitle(java.lang.String title) {
		this.title = title;
	}

	public java.lang.String getTitle() {
		return this.title;
	}


	public void setGoodsUrl(java.lang.String goodsUrl) {
		this.goodsUrl = goodsUrl;
	}

	public java.lang.String getGoodsUrl() {
		return this.goodsUrl;
	}

	public String getGoodsDetail() {
		return goodsDetail;
	}

	public void setGoodsDetail(String goodsDetail) {
		this.goodsDetail = goodsDetail;
	}

	public Address getAddress() {
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	public void setGoodsType(java.lang.Integer goodsType) {
		this.goodsType = goodsType;
	}

	public java.lang.Integer getGoodsType() {
		return this.goodsType;
	}


	public void setGmtDatetime(java.util.Date gmtDatetime) {
		this.gmtDatetime = gmtDatetime;
	}

	public java.util.Date getGmtDatetime() {
		return this.gmtDatetime;
	}


	public void setUptDatetime(java.util.Date uptDatetime) {
		this.uptDatetime = uptDatetime;
	}

	public java.util.Date getUptDatetime() {
		return this.uptDatetime;
	}

	public List<Map> getGoodsUnits() {
		return goodsUnits;
	}

	public void setGoodsUnits(List<Map> goodsUnits) {
		this.goodsUnits = goodsUnits;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
}
